package com.qf.service.impl;

import com.qf.model.entity.Hospitalnavigation;
import com.qf.dao.HospitalnavigationDao;
import com.qf.service.HospitalnavigationService;
import org.springframework.stereotype.Service;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;
import java.util.Map;

/**
 * (Hospitalnavigation)表服务实现类
 *
 * @author ZhiHuiJun
 * @since 2024-05-04 01:01:53
 */
@Service("hospitalnavigationService")
public class HospitalnavigationServiceImpl implements HospitalnavigationService {
    @Autowired
    private HospitalnavigationDao hospitalnavigationDao;

    /**
     * 通过ID查询单条数据
     *
     * @param id 主键
     * @return 实例对象
     */
    @Override
    public Hospitalnavigation queryById(Integer id) {
        return this.hospitalnavigationDao.queryById(id);
    }

    /**
     * 分页查询
     *
     * @return 查询结果
     */
    @Override
    public List<Hospitalnavigation> queryByPage(Integer pageNum) {
        return this.hospitalnavigationDao.queryAllByLimit();
    }

    /**
     * 新增数据
     *
     * @param hospitalnavigation 实例对象
     * @return 实例对象
     */
    @Override
    public boolean insert(Hospitalnavigation hospitalnavigation) {
        int i = hospitalnavigationDao.insert(hospitalnavigation);
        if (i>0){
            return true;
        }
        return false;
    }

    /**
     * 修改数据
     *
     * @param hospitalnavigation 实例对象
     * @return 实例对象
     */
    @Override
    public boolean update(Hospitalnavigation hospitalnavigation) {
        int i = hospitalnavigationDao.update(hospitalnavigation);
        if (i>0){
            return true;
        }
        return false;
    }

    /**
     * 通过主键删除数据
     *
     * @param id 主键
     * @return 是否成功
     */
    @Override
    public boolean deleteById(Integer id) {
        return this.hospitalnavigationDao.deleteById(id) > 0;
    }

    @Override
    public List<Hospitalnavigation> selectHospitalnavigationByCondition(Map<String, Object> map) {
        return hospitalnavigationDao.selectHospitalnavigationByCondition(map);
    }

    @Override
    public int delBatch(List<Integer> list) {
     int i = hospitalnavigationDao.delBatch(list);
     if (i>0){
         return 1;
     }
     return -1;
    }
}
